package com.qf.controller;

import com.qf.entity.RoomTypeVO;
import com.qf.service.EchartsService;
import com.qf.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName: EchartsController
 * @Author: WangHao
 * @Date: 2025/5/11 20:35
 * @Description:
 * @Version: 1.0
 */
@RestController
@RequestMapping("/echarts")
public class EchartsController {

    @Autowired
    private EchartsService echartsService;

    // 查询房间类型和房间数量的数据
    @GetMapping("/findRoomTypeAndCount")
    public R getData(){
        List<RoomTypeVO> list = echartsService.getRoomType();
        return R.ok(list);
    }

    // 查询房间的类型和价格
    @GetMapping("/findRoomTypeAndPrice")
    public R getRoomTypeAndPrice(){
        List<RoomTypeVO> list = echartsService.getRoomTypePrice();
        return R.ok(list);
    }
}
